<!-- 修改用户组件 -->
<template>
	<div id="updaterole">	
		<el-dialog title="修改角色菜单" :visible.sync="dialogFormVisible" append-to-body>
		  <el-form :model="form">
		    <!-- <el-form-item label="角色编号" :label-width="formLabelWidth">
		      <el-input v-model="form.id" autocomplete="off"></el-input>
		    </el-form-item> -->
				<el-form-item label="角色名字" :label-width="formLabelWidth">
				  <el-input v-model="form.rolename" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="描述" :label-width="formLabelWidth">
				  <el-input v-model="form.description" autocomplete="off"></el-input>
				</el-form-item>
				
		  </el-form>
		  <div slot="footer" class="dialog-footer">
		    <el-button @click="dialogFormVisible = false">取 消</el-button>
		    <el-button type="primary" @click="update">修  改</el-button>
		  </div>
		</el-dialog>
	</div>
</template>
<script>
  export default {
    data() {
      return {
        dialogFormVisible: this.isvisble,
        form: {
			id:"",
			rolename:"",
			description:""
		},
        formLabelWidth: '120px'
      };
    },
	props:["isvisble"],
	methods:{
		refupdateper(s,updatearr){
			this.dialogFormVisible=s;
			// updatearr是addpermismanage页面传过来的数组，数组里面有点击编辑获取的数据
			this.form.id=updatearr.id;
			this.form.rolename=updatearr.rolename;
			this.form.description=updatearr.description;
		},
		update(){
			console.log(JSON.stringify(this.form));
			this.axios.post("http://localhost:8080/role/updateEntity",this.form).then((res) => {
				alert(res.data.datamap.mess);
				this.$parent.$parent.$parent.$parent.chaxun(1);
			}).catch(err => {
				console.log(err)
			});
			this.dialogFormVisible=false;
			
		}
	}
  };
</script>

<style scoped>
</style>